package com.nbb.service;

import com.google.common.collect.Maps;
import com.nbb.bean.Agent;
import com.nbb.dao.AgentDao;
import com.nbb.itf.AgentService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * User: steak-yuqi
 * Date: 2017/9/12
 * Time: 15:16
 * Desc:
 */
@Service
public class AgentServiceImpl implements AgentService{
    @Resource
    private AgentDao agentDao;

    @Value("#{configGroupUser}")
    private Map<String, String> configGroup;

    @Value("#{configGroupUser['username']}")
    private String username;
    /**
     * 根据主键id查询用户
     *
     * @param id
     * @return
     */
    @Override
    public Agent selectAgent(int id) {
        return agentDao.selectAgentById(id);
    }


    @Override
    public Map selectZkTest(){
        Map map = Maps.newHashMap();
        map.put("username",username);
        return map;
    }
}
